//
//  ExpenseIncomeTypeView.m
//  MoneyIndividual
//
//  Created by Le Anh Tai on 1/5/14.
//  Copyright (c) 2014 Le Anh Tai. All rights reserved.
//

#import "ExpenseIncomeTypeView.h"
#import "TitleDescriptionCell.h"
#import "TitleDescriptionCell.h"

@implementation ExpenseIncomeTypeView

#pragma mark - Delegate UITableView

- (UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath
{
    static NSString *cellIdentifier = @"TitleDescriptionCell";
    
    TitleDescriptionCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
    
    if (cell == nil)
    {
        cell = [[TitleDescriptionCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
    }
    
    NSManagedObject *account = [self.objects objectAtIndex:indexPath.row];
    
    cell.titleLabel.text = [account valueForKey:NAME_KEY];
    cell.descriptionLabel.text = [account valueForKey:DESCRIPTION_KEY];
    
    return cell;
}

@end
